/*
 * @Author: 晴鸢. 3013433857@qq.com
 * @Date: 2025-08-30 10:36:38
 * @LastEditors: 晴鸢. 3013433857@qq.com
 * @LastEditTime: 2025-08-31 11:54:50
 * @FilePath: /Learn/fifo/client.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include "common.hpp"
#include "log.hpp"
using namespace std;
int main()
{
   Log log;
   log.Enable(Classfile);
   int fd = open(FIFO_FILE, O_WRONLY);
   if (fd < 0)
   {
      perror("client open");
      log(Fatal,"client error.error string:%s, error code:%d\n",strerror(errno),errno);
      exit(FIFO_OPEN_ERR);
   }
   string line;
   while (1)
   {
      cout << "Please Enter@ ";
      getline(cin, line);
      write(fd, line.c_str(), line.size());
   }
   return 0;
}
